import 'package:flutter/material.dart';

class ListPage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        List<Widget> list = <Widget>[];

        var data = [
            {"id": 1, "title": "PHP", "subtitle": "世界上最好的编程语言"},
            {"id": 2, "title": "MYSQL", "subtitle": "开源免费的数据库"}
        ];

        for(var item in data){
            var listTitle = ListTile(
                title: Text(item["title"], style: TextStyle(fontSize: 18.0)),
                subtitle: Text(item["subtitle"]),
                leading:  Icon(Icons.fastfood, color: Colors.orange),
                trailing: Icon(Icons.keyboard_arrow_right)
            );
            list.add(listTitle);
        }

        return Scaffold(
            appBar: AppBar(title: Text("List Page")),
            body: Center(
                child: ListView(children: list)
            )
        );
    }
}